import { post, get } from '../../http/axios'

export default {
    // 命名空间 ->让其他文件快速定位到
    namespaced: true,
    state: {
        hos: {}
    },
    // 突变 ->改变state中变量值的唯一方式
    mutations: {
        set_hos(state, val) {
            state.hos = val;
        }
    },
    actions: {
        async findHos({ commit }, params) {
            let res = await get('/hospital/pageQuery', params);
            commit('set_hos', res.data);
        },
        async saveHos({ commit }, params) {
            let res = await post('/hospital/saveOrUpdate', params);
            return res;
        },
        async deleteHos({ commit }, params) {
            let res = await get('/hospital/deleteById', params);
            return res;
        },
    }
}